<?php

namespace App\Requests\Admin\Help;


use App\Enums\HelpCenterStatusEnum;
use App\Requests\BaseRequest;
use App\Traits\ValidatorTrait;
use Illuminate\Validation\Rule;

class HelpCenterRequest extends BaseRequest
{
    use ValidatorTrait;

    /**
     * 字段注解
     *
     * @return array
     */
    public function attributes(): array
    {
        return [
            'category_id' => '分类ID',
            'title' => '分类名称',
            'note' => '业务类型',
            'status' => '状态',
            'sort' => '排列序号',
        ];
    }

    public function rules(): array
    {
        return [
            'id' => ['sometimes', 'integer'],
            'category_id' => ['required', 'integer'],
            'title' => ['required', 'string'],
            'note' => ['required', 'string'],
            'status' => ['required', 'integer',Rule::in(HelpCenterStatusEnum::getKeyList())],
            'sort' => ['required', 'integer'],
        ];
    }
}
